#ifndef _NETWORK_H_
#define _NETWORK_H_
#pragma once
#include "defines.h"
#include "Common/singleton.h"
#include "boost/asio.hpp"
#include "boost/bind.hpp"
#include "boost/thread.hpp"
#include "boost/shared_ptr.hpp"

#include <vector>
using namespace XGC::common;
using namespace boost;
using namespace boost::asio;
namespace XGC
{
	namespace net
	{
		class asio_NetworkBase
		{
			friend struct CreateUsingNew< asio_NetworkBase >;
		private:
			asio_NetworkBase(void);
			~asio_NetworkBase(void);

			xgc_void	handle_quit();
			xgc_void	run();	
		public:
			xgc_bool insert_workthread( xgc_int32 c );
			xgc_void shutdown();

			io_service& Ref(){ return _service; }
		private:
			io_service			_service;
			std::vector< shared_ptr< thread > >	_workthreads;
		};
	}
}
#endif // _NETWORK_H_